import { PointerEvent } from 'leafer-ui'
import { events } from '../utils/emit';
export class MouseClick {
    name = 'MenuClick'
    constructor(instance) {
        this.instance = instance;
        this.upListener = null;
    }

    MouseEvent() {
        return {
            handles: () => {
                if (!this.instance.create) {
                    this.upListener = (e) => {
                        if (e.target !== this.instance.app) {
                            events.emit('event', e.target);
                        } else {
                            events.emit('event', false);
                        }
                    };
                    this.instance.app.on(PointerEvent.CLICK, this.upListener);
                } else {
                }
            }
        };
    }
}